<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <a href="#/a">App 1</a>
    <a href="#/b">App 2</a>

    <script>
        const go = (events) => {
            debugger
            console.log('reRoute', events);
        }
        window.addEventListener('hashchange', go);
        window.addEventListener('popstate', go);
        const originAddEventListener = window.addEventListener

        window.addEventListener = function () {
            debugger
            return originAddEventListener.apply(this, arguments);

        }

        window.addEventListener('hashchange', (e) => {
            debugger
            console.log('--------------', e);
        });


    </script>

</body>

</html>